<?php
/**
 * ModerationResult
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Sponsored Brands campaign management
 *
 * Create and manage Sponsored Brands campaigns.   To learn more about Sponsored Brands campaigns, see:   - [Sponsored Brands overview](guides/sponsored-brands/overview)  - [Sponsored Brands campaign structure](guides/sponsored-brands/campaigns/structure)  - [Get started with Sponsored Brands campaigns](guides/sponsored-brands/campaigns/get-started-with-campaigns)
 *
 * OpenAPI spec version: 4.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * ModerationResult Class Doc Comment
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class ModerationResult implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'ModerationResult';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'version_id' => '\AmazonAdvertisingApi\Model\VersionId',
        'id_type' => '\AmazonAdvertisingApi\Model\IdType',
        'moderation_status' => '\AmazonAdvertisingApi\Model\ModerationStatus',
        'policy_violations' => '\AmazonAdvertisingApi\Model\PolicyViolation[]',
        'eta_for_moderation' => 'string',
        'id' => '\AmazonAdvertisingApi\Model\Id'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'version_id' => null,
        'id_type' => null,
        'moderation_status' => null,
        'policy_violations' => null,
        'eta_for_moderation' => null,
        'id' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'version_id' => 'versionId',
        'id_type' => 'idType',
        'moderation_status' => 'moderationStatus',
        'policy_violations' => 'policyViolations',
        'eta_for_moderation' => 'etaForModeration',
        'id' => 'id'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'version_id' => 'setVersionId',
        'id_type' => 'setIdType',
        'moderation_status' => 'setModerationStatus',
        'policy_violations' => 'setPolicyViolations',
        'eta_for_moderation' => 'setEtaForModeration',
        'id' => 'setId'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'version_id' => 'getVersionId',
        'id_type' => 'getIdType',
        'moderation_status' => 'getModerationStatus',
        'policy_violations' => 'getPolicyViolations',
        'eta_for_moderation' => 'getEtaForModeration',
        'id' => 'getId'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['version_id'] = isset($data['version_id']) ? $data['version_id'] : null;
        $this->container['id_type'] = isset($data['id_type']) ? $data['id_type'] : null;
        $this->container['moderation_status'] = isset($data['moderation_status']) ? $data['moderation_status'] : null;
        $this->container['policy_violations'] = isset($data['policy_violations']) ? $data['policy_violations'] : null;
        $this->container['eta_for_moderation'] = isset($data['eta_for_moderation']) ? $data['eta_for_moderation'] : null;
        $this->container['id'] = isset($data['id']) ? $data['id'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets version_id
     *
     * @return \AmazonAdvertisingApi\Model\VersionId
     */
    public function getVersionId()
    {
        return $this->container['version_id'];
    }

    /**
     * Sets version_id
     *
     * @param \AmazonAdvertisingApi\Model\VersionId $version_id version_id
     *
     * @return $this
     */
    public function setVersionId($version_id)
    {
        $this->container['version_id'] = $version_id;

        return $this;
    }

    /**
     * Gets id_type
     *
     * @return \AmazonAdvertisingApi\Model\IdType
     */
    public function getIdType()
    {
        return $this->container['id_type'];
    }

    /**
     * Sets id_type
     *
     * @param \AmazonAdvertisingApi\Model\IdType $id_type id_type
     *
     * @return $this
     */
    public function setIdType($id_type)
    {
        $this->container['id_type'] = $id_type;

        return $this;
    }

    /**
     * Gets moderation_status
     *
     * @return \AmazonAdvertisingApi\Model\ModerationStatus
     */
    public function getModerationStatus()
    {
        return $this->container['moderation_status'];
    }

    /**
     * Sets moderation_status
     *
     * @param \AmazonAdvertisingApi\Model\ModerationStatus $moderation_status moderation_status
     *
     * @return $this
     */
    public function setModerationStatus($moderation_status)
    {
        $this->container['moderation_status'] = $moderation_status;

        return $this;
    }

    /**
     * Gets policy_violations
     *
     * @return \AmazonAdvertisingApi\Model\PolicyViolation[]
     */
    public function getPolicyViolations()
    {
        return $this->container['policy_violations'];
    }

    /**
     * Sets policy_violations
     *
     * @param \AmazonAdvertisingApi\Model\PolicyViolation[] $policy_violations A list of policy violations for a campaign that has failed moderation. Note that this field is present in the response only when moderationStatus is set to REJECTED.
     *
     * @return $this
     */
    public function setPolicyViolations($policy_violations)
    {
        $this->container['policy_violations'] = $policy_violations;

        return $this;
    }

    /**
     * Gets eta_for_moderation
     *
     * @return string
     */
    public function getEtaForModeration()
    {
        return $this->container['eta_for_moderation'];
    }

    /**
     * Sets eta_for_moderation
     *
     * @param string $eta_for_moderation Expected date and time by which moderation will be complete. The format is ISO 8601 in UTC time zone. Note that this field is present in the response only when moderationStatus is set to IN_PROGRESS.
     *
     * @return $this
     */
    public function setEtaForModeration($eta_for_moderation)
    {
        $this->container['eta_for_moderation'] = $eta_for_moderation;

        return $this;
    }

    /**
     * Gets id
     *
     * @return \AmazonAdvertisingApi\Model\Id
     */
    public function getId()
    {
        return $this->container['id'];
    }

    /**
     * Sets id
     *
     * @param \AmazonAdvertisingApi\Model\Id $id id
     *
     * @return $this
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
